package com.wzm.ssm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wzm.ssm.mapper.UserMapper;
import com.wzm.ssm.model.User;

@Service
public class UserService implements IUserService{
	@Autowired
	private UserMapper userMapper;

	public User load(int id) throws  Exception{
		return userMapper.selectByPrimaryKey(id);
	}
	public List<User>  getUsers() throws Exception {
		return userMapper.selectList();
	}
	@Override
	public int add(User user) throws Exception{
		return userMapper.insert(user);
	}
	@Override
	public int update(User user) throws Exception{
		return userMapper.updateByPrimaryKey(user);
	}
	
}
